﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SmartEP.Presenter;

namespace SmartDesktop
{
    public partial class Step2View : PatientInformationBaseView, IStep2View
    {
        public Step2View(PatientCarePresenter presenter)
            : base(presenter)
        {
            InitializeComponent();
            this.Name = "Registration Step 2";
            MainForm.BarCaption.Text = this.Name;

            this.step = 2;
            this.GroupStep = GroupStepType.PatientInformation;
        }

        #region Properties
        public String FirstName
        {
            get { return txtFirstName.Text; }
            set { txtFirstName.Text = value; }
        }

        public String LastName
        {
            get { return txtLastName.Text; }
            set { txtLastName.Text = value; }
        }

        public String MiddleInitial
        {
            get { return txtMiddle.Text; }
            set { txtMiddle.Text = value; }
        }

        public String EmailAdrress
        {
            get { return txtEmailAddress.Text; }
            set { txtEmailAddress.Text = value; }
        }

        public String PhoneNumber
        {
            get { return txtPhoneNumber.Text; }
            set { txtPhoneNumber.Text = value; }
        }

        public String AltPhone
        {
            get { return txtAltPhone.Text; }
            set { txtAltPhone.Text = value; }
        }

        public String NamePrimaryCareDoctor
        {
            get { return txtNameDoctor.Text; }
            set { txtNameDoctor.Text = value; }
        }

        public DateTime DateOfBirth
        {
            get { return dtpDOB.Value; }
            set { dtpDOB.Value = value; }
        }

        public DateTime DateOfLastMedicalExam
        {
            get { return dtpDateExam.Value; }
            set { dtpDateExam.Value = value; }
        }

        public Boolean Sex
        {
            get { return rdMale.Checked; }
            set { rdMale.Checked = value; }
        }

        private int _placephone1;
        public int PlacePhone1
        {
            get { return _placephone1; }
            set
            {
                if (rdWorkPhoneNumber.Checked)
                    _placephone1 = 1;
                else if (rdHomePhoneNumber.Checked)
                    _placephone1 = 2;
                else
                    _placephone1 = 3;
            }
        }

        private int _placephone2;
        public int PlacePhone2
        {
            get { return _placephone2; }
            set
            {
                if (rdWorkAltPhone.Checked)
                    _placephone2 = 1;
                else if (rdHomeAltPhone.Checked)
                    _placephone2 = 2;
                else
                    _placephone2 = 3;
            }
        }

        private int _howtoknow;
        public int HowToKnow
        {
            get { return _howtoknow; }
            set
            {
                if (rdFriend.Checked)
                    _howtoknow = 1;
                else if (rdInternet.Checked)
                    _howtoknow = 2;
                else if (rdInsuarance.Checked)
                    _howtoknow = 3;
                else if (rdRadioTV.Checked)
                    _howtoknow = 4;
                else if (rdPrintAd.Checked)
                    _howtoknow = 5;
                else
                    _howtoknow = 6;


            }
        }
        #endregion

        private void btnContinue_Click(object sender, EventArgs e)
        {
            this.presenter.DisplayNextStep(this.step);
        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            this.presenter.BackToPreviousStep(this.step);
        }

    }
}
